import request from "@/src/utils/request";

/* 发送登陆短信验证码 */
export function getLoginSmsCode(phoneNumber) {
    return request({
        url: "/system/sms/getLoginSmsCode/" + phoneNumber,
        method: "post",
        headers: {
            isToken: false,
        },
    });
}
/* 发送短信注册验证码 */
export function getRegisterSmsCode(phoneNumber) {
    return request({
        url: "/system/sms/getRegisterSmsCode/" + phoneNumber,
        method: "post",
        headers: {
            isToken: false,
        },
    });
}
/* 获取图形验证码 */
export function getCodeImg() {
    return request({
        url: "/captchaImage",
        headers: {
            isToken: false,
        },
        method: "get",
        timeout: 20000,
    });
}

// 短信登录
export function smsLogin(data) {
    return request({
        url: "/smsLogin",
        method: "post",
        headers: {
            isToken: false,
        },
        data: data,
    });
}
//短信注册
export function register(data) {
    return request({
        url: "/register",
        headers: {
            isToken: false,
        },
        method: "post",
        data: data,
    });
}

// 注销登录
export function logout() {
    return request({
        url: "/logout",
        method: "post",
    });
}

// 获取用户信息
export function getInfo() {
    return request({
        url: "/getInfo",
        method: "get",
    });
}

//微信登录
export function wxLogin(data) {
    return request({
        url: "/wxLogin",
        method: "post",
        data: data,
    });
}
//h5微信登录
export function h5Login(data) {
    return request({
        url: "/h5Login",
        method: "post",
        data: data,
    });
}
//更新微信登录信息
export function updateWxQrCode(data) {
    return request({
        url: "/updateWxQrCode",
        method: "post",
        data: data,
    });
}
//微信验证码
export function getWxRegisterSmsCode(data) {
    return request({
        url: "/system/sms/getWxRegisterSmsCode",
        method: "post",
        data: data,
    });
}

//微信注册
export function wxRegister(data) {
    return request({
        url: "/wxRegister",
        method: "post",
        data: data,
    });
}
//获取微信H5短信
export function getUserPhoneSmsCode(data) {
    return request({
        url: "/system/sms/getUserPhoneSmsCode",
        method: "post",
        data: data,
    });
}
//更新H5端手机号
export function updatePhone(data) {
    return request({
        url: "/system/user/updatePhone",
        method: "post",
        data: data,
    });
}